package proyecto.gestionarDatosDeRequisitosDeConocimientosPrevios;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import util.Common;

public class RequisitosConocimientosPreviosSeleccionadosAction extends Action {

	public ActionForward execute(
			ActionMapping mapping,
			ActionForm form,			
			HttpServletRequest request,
			HttpServletResponse response) {
		
		if (isCancelled(request)){	
			System.out.println("presione cancelar");
			return mapping.findForward(Common.FAILURE);
		}
		else{
			
			try {
								
				if ("request".equals(mapping.getScope())) {				
					request.setAttribute(mapping.getAttribute(), form);
				}
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
								
			return mapping.findForward(Common.INICIAL);
		}
	}	
}
